﻿using SHKF.B2C.Model.Dto;
using SHKF.B2C.YouZanYun.Model.Inter.Organization;
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes; 

namespace SHKF.B2C.Mannage.AdminUI.View.CenterInfo.Shop
{
    /// <summary>
    /// frmFindShopYzy.xaml 的交互逻辑
    /// </summary>
    public partial class frmFindShopYzy : Window
    {
        public frmFindShopYzy()
        {
            InitializeComponent();
        }

        private void btnOK_Click(object sender, RoutedEventArgs e)
        {
            if (this.dgv.SelectedValue == null)
            {
                return;
            }

            OrganizationData data = this.dgv.SelectedValue as OrganizationData;
            this.app_poi_code = data.kdt_id;

            this.DialogResult = true;
            this.Close();
        }

        private async void Window_Loaded(object sender, RoutedEventArgs e)
        {
           DataDto dto = await GL.HttpClientManage.ShopGetKdtId(CompanySN); 
            OrganizationResult result = await GL.HttpClientYzy.GetShopList(dto.data);
            if (result.success)
            {
                this.dgv.ItemsSource = result.data;
            }
            else
            {
                MessageBox.Show(result.message);
            }
        }

        public long CompanySN = 0;

        public long app_poi_code = 0;
    }
}
